<%--
  Created by IntelliJ IDEA.
  User: wen
  Date: 2018/6/14
  Time: 12:19
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>java面试题页面</title>
  <script type="text/javascript"  src="/js/jquery-2.1.3.min.js"></script>
  <script type="text/javascript">
      function begin() {
          $.ajax({
              type: "POST",
              url: "/java/get.do",
              success: function(data){
                 if(data.status == 0){
                    /* alert(data.status);*/
                     $("#begin").attr({value: "下一题"});
                     $("#head").text(data.data[0].id+"\."+data.data[0].question);
                     $("#answer").text(data.data[0].answer);
                 }else {
                     alert(data.msg);
                 }
              }
          });
      }
      function toInfo() {
          window.location.href = "/view/userInfo.jsp";
      }
      function logout() {
          window.location.href = "/index.jsp";
      }
  </script>

</head>
<body>
<input type="button" value="开始练习" id="begin" onclick="begin()">
<input type="button" value="返回个人信息页面" id="toInfo" onclick="toInfo()">
<input type="button" value="退出登录"  onclick="logout()">

<p id="head"></p>
<p id="answer"></p>
</body>
</html>
